using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using YayiMgr.Ability.Docking.Commom;
using YayiMgr.Ability.Docking.DentistsApp;
using YayiMgr.Ability.Docking.DentistsApp.Dto;

namespace YayiMgr.Web.Controllers
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class DentistsController : ControllerBase
    {
        public IDentistsServicer DentistsSvr { get; set; }

        [HttpGet]
        public async Task<QueryListDto<DentistsDto>> Get()
        {
            return await DentistsSvr.GetAllDentists();
        }

        [HttpPost]
        public async Task<QueryListDto<DentistsDto>> Get(DentistsQueryDto dto)
        {
            return await DentistsSvr.GetDentists(dto);
        }

   
        [HttpGet("{id}")]
        public async Task<ResponseDto<DentistsDto>> Get(Guid id)
        {
            return await DentistsSvr.GetDentistsById(id);
        }


        [HttpPost]
        public async Task<ResponseDto<DentistsDto>> Post(DentistsCreateDto input)
        {
            return await DentistsSvr.AddDentists(input);
        }


        [HttpPut("{id}")]
        public async void Put(Guid id, DentistsUpdateDto input)
        {
            await DentistsSvr.UpdateDentists(id,input);
        }


        [HttpDelete("{id}")]
        public async void Delete(Guid id)
        {
            await DentistsSvr.DeleteDentists(id);
        }
        
    }
}